package com.spica.platform.base.feign;

import com.spica.platform.base.config.BaseFeignConfig;
import com.spica.platform.base.feign.fallback.AsyncMenuFeignClientFallbackFactory;
import com.spica.platform.base.model.SysMenu;
import com.spica.platform.common.constant.CommonConstant;
import com.spica.platform.common.constant.ServiceNameConstant;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;
import reactivefeign.spring.config.ReactiveFeignClient;
import reactor.core.publisher.Mono;

import java.util.List;

@ReactiveFeignClient(name = ServiceNameConstant.USER_SERVICE,configuration = BaseFeignConfig.class , fallbackFactory = AsyncMenuFeignClientFallbackFactory.class, decode404 = true)
public interface AsyncMenuFeignClient {
	/**
	 * 角色菜单列表
	 * @param roleCodes
	 */
	@GetMapping(value = "/menus/roleCodes", params = "roleCodes")
	Mono<List<SysMenu>> findMenusByRoleCodes(@RequestHeader(CommonConstant.TENANT_ID_PARAM) String tenant , @RequestParam("roleCodes") String roleCodes);
}
